//
//  FirmwareInformationCell.swift
//  DaRings
//
//  Created by 易先生 on 2022/10/31.
//

import UIKit
import MYModule

open class FirmwareInformationCell: TableViewCell {


    open override func makeUI() {
        super.makeUI()
        
        contentView.backgroundColor = UIColor.background

        contentView.addSubview(titleLabel)
        
        contentView.addSubview(descLabel)

    
        titleLabel.snp.makeConstraints { make in
            make.top.equalToSuperview().offset(16)
            make.leading.equalToSuperview().offset(30)
            make.trailing.lessThanOrEqualTo(descLabel.snp.leading).offset(-10)
        }

        descLabel.snp.makeConstraints { make in
            make.trailing.equalToSuperview().offset(-30)
            make.centerY.equalToSuperview()
        }
        
        
    }
    
    public func bind(to cellModel: FirmwareInformationCelleModel) {
        titleLabel.text = cellModel.action.title
        descLabel.text = cellModel.value
    }
    
    public lazy var titleLabel: Label = {
        let titleLabel = Label()
        titleLabel.textColor = UIColor.assist_222222
        titleLabel.numberOfLines = 0
        titleLabel.font = Fonts.systemFont(ofSize: 16)
        return titleLabel
    }()
    
    private lazy var descLabel: Label = {
        let descLabel = Label()
        descLabel.textColor = UIColor.assist_A9A9A9
        descLabel.numberOfLines = 0
        descLabel.font = Fonts.systemFont(ofSize: 12)
        return descLabel
    }()
    

    open override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
